<ion-header-bar align-title="center" class="bar bar-header bar-light" style='background: url(img/icon/headerline.png); background-size: contain; background-position: bottom; background-repeat: no-repeat;'>
  <a class="button icon-left ion-ios-arrow-left button-clear button-light" ng-click="backGo()"></a>
  <h1 class="title">我的已办</h1>
</ion-header-bar>

<div class="tabs-striped tabs-top tabs-light tabs-icon-top" ng-show="edit">
  <div class="tabs" style="background-color:#F6F6F6;">
    <a ng-class="{detail: 'tab-item active', comment: 'tab-item'}[isActive]" data-active="detail"
       ng-click="changeTab($event)" style="font-size:16px;line-height:48px;">详情</a>
    <a ng-class="{detail: 'tab-item', comment: 'tab-item active'}[isActive]" data-active="comment"
       ng-click="changeTab($event)" style="font-size:16px;line-height:48px;">审批记录</a>
  </div>
</div>
<ion-content class="content bg">
    <ion-refresher pulling-text="<span class='pulling-text-auto'>{{pulltextchange}}</span>" on-refresh="doRefresh()"
                   on-pulling="pulltext()" spinner="ripple" pulling-icon="ion-ios-refresh-empty"></ion-refresher>
    <ul class="list" ng-show="!edit">
        <li class="item item-icon-right" ng-repeat="alreadydo in alreadydos" ng-click="show(alreadydo)" style="border: none; margin-top: 1.5%;">
            <a class="button icon-right ion-ios-arrow-right button-clear button-light" style="position:absolute; top: 20px; right: 10px;"></a>
            <img style="float: left; width: 15px; height: 15px; position: relative; left: -3px;top: 2px;" src="img/icon/icon_assetName.png"/>
            <h2>{{alreadydo.processDefinitionName}}</h2>
            <hr style="margin-left: -20px;border-top-style: initial;"/>
            <p ng-show ="alreadydo.form.title">标题：<span>{{alreadydo.form.title}}</span></p>
            <p>发起人：<span ed-options="user">{{alreadydo.starter}}</span></p>
            <p>发起时间：{{alreadydo.createTime}}</p>
        </li>
    </ul>
    <div ng-show="edit"  style="padding-top: 44px;">
      <ion-list ng-if="isActive == 'detail'">
        <div class="detailContent" style="padding-top: 3%;padding-bottom: 3%;">
          <div style="border: 0px solid #fff;padding-top: 1%;" ng-repeat="field in fields " ng-show="field.showType!=0">
            <div style="display: inline-block;width: 100px">{{field.title}}:</div>
            <span style="color: #666;overflow: hidden;" ng-if="field.options" ed-options="{{field.options}}">{{field.value}}</span>
            <span style="color: #666;overflow: hidden;" ng-if="(!field.options)&&field.col!='files'">{{field.value}}</span>
            <div ng-repeat = "file in fields.files" ng-if="field.col=='files'">
                <span><a href="#" ng-click="mClick(file.url)">{{file.name}}</a></span>
            </div>
            </div>
        </div>
        </ion-list>
      <ion-list ng-if="isActive == 'comment'" >
        <div ng-repeat="comment in comments ">
          <div ng-if="comment ==comments[0]">
            <div class="card" style=" margin-left: 25%;padding-left: 2%;padding-top: 2%;margin-bottom: 0;">
              <p>审批人：<span ed-options="user">{{comment.approver}}</span></p>
              <p>审批节点：{{comment.taskName}}</p>
              <p style="color: green">审批意见：{{comment.message}}</p>
              <p>审批时间：{{comment.addTime}}</p>
            </div>
            <div class="ion-ionic" style="color:green;font-size: 30px;position: relative;bottom: 82px;left: 9%;display: block;">
              <table class="jcline" style="height:135px;border:1px dashed #ddd;border-left-style:dashed;border-width:1px;float: left;position: relative;top: 25px;"><tr><td valign="top"></td></tr></table></div>
          </div>
          <div ng-if="comment !=comments[0]">
            <div class="card" style=" margin-left: 25%;padding-left: 2%;padding-top: 2%;margin-top: 0;margin-bottom: 0;">
              <p>审批人：<span ed-options="user">{{comment.approver}}</span></p>
              <p>审批节点：{{comment.taskName}}</p>
              <p style="color: green">审批意见：{{comment.message}}</p>
              <p>审批时间：{{comment.addTime}}</p>
            </div>
            <div class="ion-arrow-up-c" style="color:green;font-size: 30px;position: relative;bottom: 82px;left: 10%;display: block;">
              <table class="jcline_2" style="height:135px;border:1px dashed #ddd;border-left-style:dashed;border-width:1px;float: left;position: relative;top: 25px;"><tr><td valign="top"></td></tr></table></div>
          </div>
        </div>
      </ion-list>
    </div>

    <div ed-ion-infinite-scroll></div>
</ion-content>
